<%@page contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page import="sf.event.model.*"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>spring-jpa-tutorial Web Application</title>
<style type="text/css">
table,th,td {
	font-family: sans-serif;
	font-size: 8pt;
	border-collapse: collapse;
	border: 1px solid #aaa;
	margin: 2px;
	padding: 2px;
}
</style>
</head>

<body>
	<form method="POST" action="event_add.html">
		Name: <input type="text" name="name" /> <input type="submit"
			value="Add" />
	</form>

	<hr>
	<c:if test="${!empty eventList}">
		<table>
			<thead>
				<tr>
					<th>ID</th>
					<th>Name</th>
					<th>Start Date</th>
					<th>Duration</th>
					<th>&nbsp;</th>
				</tr>
			</thead>
			<c:forEach items="${eventList}" var="event">
				<tr>
					<td>${event.id}</td>
					<td>${event.name}</td>
					<td>${event.startDate}</td>
					<td>${event.duration}</td>
					<td><a href="event_delete/${event.id}">delete</a></td>
				</tr>
			</c:forEach>
		</table>
	</c:if>
</body>
</html>